<!-- 工作台 》 科室工作台 -->

<template>
  <div class="work-bench-department">
    <div class="work-bench-department__top">
      <el-form>
        <FormTree bind="organId" :dict="CORE.ORGAN.DICT" initRoot noLabel small @change="changeOrgan" />
      </el-form>
    </div>
    <div class="work-bench-department__wrapper">
      <el-row>
        <el-col :span="6">
          <div class="work-bench-department__wrapper-2">
            <DeptDeviceStatus class="work-bench-department__item work-bench-department__wrapper-2__item" />
            <DeptRepair
              class="work-bench-department__item work-bench-department__wrapper-2__item"
              :organ-id="$route.params.type"
            />
          </div>
        </el-col>
        <el-col :span="12">
          <div class="work-bench-department__wrapper-2">
            <DeptArea
              class="work-bench-department__item work-bench-department__wrapper-2__item"
              :organ-id="$route.params.type"
            />
          </div>
        </el-col>
        <el-col :span="6">
          <div class="work-bench-department__wrapper-2">
            <DeptEnergy
              class="work-bench-department__item work-bench-department__wrapper-2__item"
              :organ-id="$route.params.type"
            />
            <DeptEnergyPie
              class="work-bench-department__item work-bench-department__wrapper-2__item"
              :organ-id="$route.params.type"
            />
          </div>
        </el-col>
      </el-row>
    </div>
    <div class="work-bench-department__wrapper">
      <el-row>
        <el-col :span="6">
          <div class="work-bench-department__wrapper-2">
            <DeptAlarm
              class="work-bench-department__item work-bench-department__wrapper-2__item"
              :organ-id="$route.params.type"
            />
            <DeptPlan
              class="work-bench-department__item work-bench-department__wrapper-2__item"
              :organ-id="$route.params.type"
            />
          </div>
        </el-col>
        <el-col :span="12">
          <div class="work-bench-department__wrapper-2">
            <DeptGroupOverview2
              class="work-bench-department__item work-bench-department__wrapper-2__item"
              organ-id="1"
            />
          </div>
        </el-col>
        <el-col :span="6">
          <div class="work-bench-department__wrapper-2">
            <DeptSpareList
              class="work-bench-department__item work-bench-department__wrapper-2__item"
              :organ-id="$route.params.type"
            />
            <DeptContractList
              class="work-bench-department__item work-bench-department__wrapper-2__item"
              :organ-id="$route.params.type"
            />
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'WorkbenchDepartment',

  /**
   * 组件导入 (Abc.vue + Abc/index.vue)
   */
  ...CORE.components(require.context('./', true, /vue$/)),

  /**
   * 状态数据 (函数返回对象)
   */
  data() {
    return {
      obj: { organId: '' },
    }
  },

  /**
   * 本地方法 (轻量重要在前)
   */
  methods: {
    /**
     * 切换组织
     */
    changeOrgan(organId) {
      this.$router.replace(organId)
    },
  },
}
</script>

<style lang="scss">
@import './index.scss';
</style>
